﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;

namespace CodeIn.Modules.Graph.Modules.Ui.Flow.View {
	public class NodeVisual : DrawingVisual {
		private Point p;
		public Point P {
			get { return p; }
			set {
				p = value;
				translateTransform.X = p.X;
				translateTransform.Y = p.Y;
			}
		}

		private ScaleTransform scaleTransform;
		private RotateTransform rotateTransform;
		private TranslateTransform translateTransform;

		public NodeVisual() {
			DrawingContext dc = RenderOpen();
			dc.DrawDrawing(FlowResources.NodeBaseDrawing);
			dc.Close();

			scaleTransform = new ScaleTransform();
			rotateTransform = new RotateTransform();
			translateTransform = new TranslateTransform();

			TransformGroup tg = new TransformGroup();
			tg.Children.Add(scaleTransform);
			tg.Children.Add(rotateTransform);
			tg.Children.Add(translateTransform);
			Transform = tg;
		}
	}
}
